package com.fengye;

import com.fengye.config.PropertyConfigHelper;
import com.google.common.collect.Maps;

import java.util.*;

public class Main {
    public static void main(String[] args) {
        String zkService = PropertyConfigHelper.getZkService();
        System.out.println(zkService);

        Map<String, String> map = Maps.newConcurrentMap();
        map.put("1", "a");
        map.put("2", "b");
        map.put("3", "c");
        map.put("4", "d");

        Set<String> keySet = map.keySet();
        for(String key: keySet) {
            System.out.println(key);
            map.remove(key);
        }

        Iterator<String> keyItr = map.keySet().iterator();
        while (keyItr.hasNext()) {
            String key = keyItr.next();
            System.out.println(key);
            map.remove(key);
        }

        for(Map.Entry<String, String> entry : map.entrySet()) {
            System.out.println(entry.getKey() + " " +entry.getValue());
            String value = entry.getValue();
            map.remove(entry.getKey());
        }
    }
}